#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<errno.h>
int main()
{
	FILE* pf1 = fopen("data.txt", "r");
	if (!pf1)
	{
		perror("fopen1");
		return 1;
	}
	FILE* pf2 = fopen("data_copy.txt", "w");
	if (!pf2)
	{
		perror("fopen2");
		return 1;
	}
	char s[10] = { 0 };
	while (fgets(s, 3, pf1) != NULL)
		fputs(s, pf2);
	fclose(pf1);
	pf1 = NULL;
	fclose(pf2);
	pf2 = NULL;
	return 0;
}
